package 单例模式;

/**
 * 内部类方式 单例模式
 * 有点 1.线程安全  2.不用使用同步关键字 3.实现懒加载
 */
public class SignClass {
    private SignClass(){
        System.out.println("signClass is created.. ");
    }
    private static class SignClassInside{
        private static final SignClass signClass = new SignClass();
    }
    public static SignClass instance(){
        return SignClassInside.signClass;
    }

    public static void main(String[] args) {
        SignClass.instance();
    }
}
